package org.snia.cdmi;

public enum ContainerClass {

    Object("object"),

    File("file"),
    
    Block("block");


    public static ContainerClass fromValue(String StorageClassString) throws IllegalArgumentException {
        for (ContainerClass storageClass : ContainerClass.values()) {
            if (storageClass.toString().equals(StorageClassString)) return storageClass;
        }

        throw new IllegalArgumentException(
                "Cannot create enum from " + StorageClassString + " value!");
    }


    private final String storageClassId;

    private ContainerClass(String id) {
        this.storageClassId = id;
    }

    /* (non-Javadoc)
     * @see java.lang.Enum#toString()
     */
    @Override
    public String toString() {
        return storageClassId;
    }

}